.class public Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;
.super Landroid/widget/LinearLayout;

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Ljava/util/Observer;


# instance fields
.field private a:Lcom/waiqin365/lightapp/view/CustomDeleteListView;

.field private b:Lcom/waiqin365/lightapp/view/adapter/SwipeMenuLayout;

.field private c:Lcom/baoyz/swipemenulistview/a;

.field private d:Lcom/waiqin365/lightapp/view/adapter/c;

.field private e:I


# direct methods
.method public constructor <init>(Lcom/baoyz/swipemenulistview/a;Lcom/waiqin365/lightapp/view/CustomDeleteListView;)V
    .locals 4

    invoke-virtual {p1}, Lcom/baoyz/swipemenulistview/a;->a()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    iput-object p2, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->a:Lcom/waiqin365/lightapp/view/CustomDeleteListView;

    iput-object p1, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->c:Lcom/baoyz/swipemenulistview/a;

    invoke-virtual {p1}, Lcom/baoyz/swipemenulistview/a;->b()Ljava/util/List;

    move-result-object v1

    const/4 v0, 0x0

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    move v1, v0

    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/baoyz/swipemenulistview/d;

    add-int/lit8 v2, v1, 0x1

    invoke-direct {p0, v0, v1}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->a(Lcom/baoyz/swipemenulistview/d;I)V

    move v1, v2

    goto :goto_0

    :cond_0
    return-void
.end method

.method private a(Lcom/baoyz/swipemenulistview/d;)Landroid/widget/ImageView;
    .locals 2

    new-instance v0, Landroid/widget/ImageView;

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    iget-object v1, p1, Lcom/baoyz/swipemenulistview/d;->c:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    return-object v0
.end method

.method private a(Lcom/baoyz/swipemenulistview/d;I)V
    .locals 3

    invoke-virtual {p1, p0}, Lcom/baoyz/swipemenulistview/d;->addObserver(Ljava/util/Observer;)V

    new-instance v0, Landroid/widget/LinearLayout$LayoutParams;

    iget v1, p1, Lcom/baoyz/swipemenulistview/d;->g:I

    const/4 v2, -0x1

    invoke-direct {v0, v1, v2}, Landroid/widget/LinearLayout$LayoutParams;-><init>(II)V

    new-instance v1, Landroid/widget/LinearLayout;

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    invoke-virtual {v1, p2}, Landroid/widget/LinearLayout;->setId(I)V

    const/16 v2, 0x11

    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->setGravity(I)V

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->setOrientation(I)V

    invoke-virtual {v1, v0}, Landroid/widget/LinearLayout;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v0, p1, Lcom/baoyz/swipemenulistview/d;->d:Landroid/graphics/drawable/Drawable;

    invoke-virtual {v1, v0}, Landroid/widget/LinearLayout;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    invoke-virtual {v1, p0}, Landroid/widget/LinearLayout;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    invoke-virtual {p0, v1}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->addView(Landroid/view/View;)V

    iget-object v0, p1, Lcom/baoyz/swipemenulistview/d;->c:Landroid/graphics/drawable/Drawable;

    if-eqz v0, :cond_0

    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->a(Lcom/baoyz/swipemenulistview/d;)Landroid/widget/ImageView;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    :cond_0
    iget-object v0, p1, Lcom/baoyz/swipemenulistview/d;->b:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_1

    invoke-direct {p0, p1}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->b(Lcom/baoyz/swipemenulistview/d;)Landroid/widget/TextView;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    :cond_1
    return-void
.end method

.method private b(Lcom/baoyz/swipemenulistview/d;)Landroid/widget/TextView;
    .locals 2

    new-instance v0, Landroid/widget/TextView;

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/TextView;-><init>(Landroid/content/Context;)V

    iget-object v1, p1, Lcom/baoyz/swipemenulistview/d;->b:Ljava/lang/String;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    const/16 v1, 0x11

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setGravity(I)V

    iget v1, p1, Lcom/baoyz/swipemenulistview/d;->f:I

    int-to-float v1, v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextSize(F)V

    iget v1, p1, Lcom/baoyz/swipemenulistview/d;->e:I

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setTextColor(I)V

    return-object v0
.end method

.method private c()V
    .locals 4

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->removeAllViews()V

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->c:Lcom/baoyz/swipemenulistview/a;

    invoke-virtual {v0}, Lcom/baoyz/swipemenulistview/a;->b()Ljava/util/List;

    move-result-object v1

    const/4 v0, 0x0

    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    move v1, v0

    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/baoyz/swipemenulistview/d;

    add-int/lit8 v2, v1, 0x1

    invoke-direct {p0, v0, v1}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->a(Lcom/baoyz/swipemenulistview/d;I)V

    move v1, v2

    goto :goto_0

    :cond_0
    return-void
.end method


# virtual methods
.method public a()I
    .locals 1

    iget v0, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->e:I

    return v0
.end method

.method public b()Lcom/baoyz/swipemenulistview/a;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->c:Lcom/baoyz/swipemenulistview/a;

    return-object v0
.end method

.method public onClick(Landroid/view/View;)V
    .locals 3

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->d:Lcom/waiqin365/lightapp/view/adapter/c;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->b:Lcom/waiqin365/lightapp/view/adapter/SwipeMenuLayout;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuLayout;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->d:Lcom/waiqin365/lightapp/view/adapter/c;

    iget-object v1, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->c:Lcom/baoyz/swipemenulistview/a;

    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v2

    invoke-interface {v0, p0, v1, v2}, Lcom/waiqin365/lightapp/view/adapter/c;->a(Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;Lcom/baoyz/swipemenulistview/a;I)V

    :cond_0
    return-void
.end method

.method public setLayout(Lcom/waiqin365/lightapp/view/adapter/SwipeMenuLayout;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->b:Lcom/waiqin365/lightapp/view/adapter/SwipeMenuLayout;

    return-void
.end method

.method public setOnSwipeItemClickListener(Lcom/waiqin365/lightapp/view/adapter/c;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->d:Lcom/waiqin365/lightapp/view/adapter/c;

    return-void
.end method

.method public setPosition(I)V
    .locals 0

    iput p1, p0, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->e:I

    return-void
.end method

.method public update(Ljava/util/Observable;Ljava/lang/Object;)V
    .locals 0

    invoke-direct {p0}, Lcom/waiqin365/lightapp/view/adapter/SwipeMenuView;->c()V

    return-void
.end method
